<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.util.Iterator"%>
 
<%@ page import="org.limp.mine.Label"%>
<%@ page import="org.limp.mine.Controller"%>	
<%@ page import="org.limp.mine.DateTrimmer"%>
<% 
    String context = jt.classic.system.ISystem.getContextPath();
	Object[] result = (Object[])request.getAttribute("result");	
	
	Label label = (Label)result[1];
	Controller controller = (Controller)result[2];	
	String pageNO = (String)result[3];
	List resultList = (List) result[0];
	
	String STAMP_NO = (String)request.getAttribute("STAMP_NO");
	if(STAMP_NO==null || "".equals(STAMP_NO)){
		STAMP_NO="";
	}
	String myyear = (String)request.getAttribute("myyear");
	Date date= new Date();
	 
	int the_year = date.getYear()+1900;
	int xz_year=0;
	if(myyear==null || "".equals(myyear)){
		
		myyear=(date.getYear()+1900)+"";
		 
	}
	xz_year = Integer.parseInt(myyear);
%>
<html>
<head>
<title>油票年统计列表</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<jsp:include page="../../head.jsp"></jsp:include>
<script language="javascript">
  var context='<%=context%>'; 
  function handleQuery(){
    document.form1.action = context + "/app/clsqd.do?method=listyp_query";
    document.form1.submit();
  }
  
    
   
  function handleReresh(){
      window.location.href = context + "/app/clsqd.do?method=listyp_query&pageNO=<%=pageNO%>";
  }
</script>
<script src="<%=context%>/resources/common/js/common.js"></script>
<body onload="inithelper();">
<form name="form1" method="post" action="">
<input type="hidden" name="pageNO" value="<%=pageNO%>">
<br/>
<div style="width:90%;margin:5px;"><h1>油票分配年统计列表</h1></div>
<table class="tab4list" border="0" width="95%" cellspacing="0" cellpadding="0" align="center">
  <tr>
   <td colspan="5" align="left" class="td0">
            油票编号： <input type="text" class="box3" name="STAMP_NO" value="<%=STAMP_NO%>">
            年份： <select name="myyear" SIZE="1">
            		<option value=""></option>
            		<option value="<%=the_year-2%>" <%if(the_year-2==xz_year){%>selected<%}%>><%=the_year-2%></option>
                    <option value="<%=the_year-1 %>"<%if(the_year-1==xz_year){%>selected<%}%>><%=the_year-1 %></option>
                    <option value="<%=the_year%>"<%if(the_year==xz_year){%>selected<%}%>><%=the_year%></option>
                    <option value="<%=the_year+1%>"<%if(the_year+1==xz_year){%>selected<%}%>><%=the_year+1%></option>
                    <option value="<%=the_year+2 %>"<%if(the_year+2==xz_year){%>selected<%}%>><%=the_year+2%></option>
                 </select>
      <img src="/oa/system/workflow/images/query.png" title="查询" style="cursor:hand;margin-bottom:-4px;" onclick="javascript:handleQuery();"/>查询      
   </td>
  </tr>
  <tr class="tr0" bgcolor="#A7CADE">
    <td class="td1" width="5%">&nbsp;</td>
  	<td class="td1" width="30%">&nbsp;油票编号</td>
    <td class="td1" width="20%">&nbsp;分配油票总数</td>
    <td class="td1" width="20%">&nbsp;燃油量</td>
    <td class="td1" width="20%">&nbsp;总燃油量</td>
    
  </tr>
  <% 
    if(resultList!=null&&!resultList.isEmpty()){
    
       for(int i=0;i<resultList.size();i++){
	       Map info = (Map)resultList.get(i);
	       String number = (String)info.get("PAGINATION_NUMBER");
	       String stamp_no = info.get("STAMP_NO").toString();
	       String stamp_fp = info.get("STAMP_FP").toString();
           String stamp_count = info.get("STAMP_COUNT").toString();
           
           
           //String mytime = DateTrimmer.format2YYYYMMdd(SEND_TIME);
          
           
          
  %> 
  <tr onMouseOver="javascript:this.bgColor='#ffff99'" onmouseout=" javascript:this.bgColor='#F5F7F9'" bgColor="#F5F7F9"> 
    <td>&nbsp;<%=number%></td>
    <td>&nbsp;<%=stamp_no%></td>
    <td>&nbsp;<%=stamp_fp%></td>
    <td>&nbsp;<%=stamp_count%></td>
    <td>&nbsp;<%=Integer.parseInt(stamp_fp)*Integer.parseInt(stamp_count)%></td>
    
  </tr>
  <%
        }
     }
  %>
</table> 
<table width="95%" class="tab-noborder" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
   <td>
    <%=label.displayLabel()%>
   </td>
   <td align="right">
        <%=label.startLabel()%>
        <%=label.previousLabel()%>
        <%=label.nextLabel()%>
        <%=label.endLabel()%>
        <%=controller.getController().toString()%>
    </td>
  </tr>
</table>  
<%=controller.getControlScript(true)%> 
</form>
</body>
</html>	